/**
 * API 接口公用类型
 */

export type RecordParams = SearchParams & ParamsPage;

export interface SearchParams {
    fileName?: string;
    creator?: string;
    createStartTime?: string;
    createEndTime?: string;
    serviceType: keyof typeof EServiceType;
    operateType?: 'IMPORT' | 'EXPORT';
}

export interface RecordResponse extends ResponsePage {
    records: Records[];
}

export interface Records {
    id: number;
    fileName: string;
    creator: string;
    type: string;
    status: boolean;
    createTime: string;
}

export enum EServiceType {
    TASK_VIEW = 'TASK_VIEW', // 任务视图
    PROCESS_DETAIL = 'PROCESS_DETAIL', // 工序排程明细
    SUGGESTED_PLAN = 'SUGGESTED_PLAN', //建议计划
    PURCHASE_PLAN = 'PURCHASE_PLAN', // 采购计划
    ORDER_INFORMATION = 'ORDER_INFORMATION', //需求订单
    PRODUCTION_REPORTING = 'PRODUCTION_REPORTING', // 生产报工
    NESTING_ANALYSIS = 'NESTING_ANALYSIS', //齐套分析
    DEVICE_LOAD = 'DEVICE_LOAD', //设备负荷表
    BOM = 'BOM', // BOM
    ASSISTANT_RESOURCE = 'ASSISTANT_RESOURCE', // 辅助资源
    DEVICE = 'DEVICE', //设备管理
    CUSTOMER_INFORMATION = 'CUSTOMER_INFORMATION', // 客户信息
    SUPPLIER = 'SUPPLIER', //供应商
    MATERIAL = 'MATERIAL', // 物料
    WORK_SHOP = 'WORK_SHOP', // 车间
    USER = 'USER', // 用户管理
    ROLE = 'ROLE', // 角色
    PROCESS = 'PROCESS', // 工艺
    WORKING_PROCEDURE = 'WORKING_PROCEDURE' // 工序
}

// 请求页码统一参数
export interface ParamsPage {
    current: number;
    size: number;
}

// 返回页码统一参数
export interface ResponsePage {
    total: number;
    size: number;
    current: number;
    pages: number;
}
